function FormClass () {
	this.prototype = {};
	this.qnty_elem = 'items_qnty';
	this.wrapper = 'items';
	this.ItemNamePrefix = 'item';
	this.action = 'addForm';
	this.PathToAjaxBackend = 'index.php';
	this.FormTemplate = 'form.html';
	this.returned = '';
	this.addForm = function()
	{
		var obj = this;
		var items_qnty = $('#'+obj.qnty_elem).attr("value");
		//action='addForm';
		// Create new JsHttpRequest object.
	    var req = new JsHttpRequest();
	    
	    // Code automatically called on load finishing.
	    req.onreadystatechange = function() {
	        if (req.readyState == 4) {
	            //get errors from backend
	            if(req.responseText)
	            {
	                alert(req.responseText);
	            }
				//get data from backend		
	            else if (req.responseJS.ok == '1')
	            {
				    items_qnty++;
	            	//$("#"+obj.wrapper).append(req.responseJS.output);
					$('#'+obj.qnty_elem).attr("value",items_qnty);
					//$("#experiences").accordion({autoHeight: false,collapsible: true});
					$('.slider').slider();
					obj.returned = req.responseJS.output;
	            }
	            else
	            {
	            	$.facebox(req.responseJS.output);
	            }
			}
	    }
	    try_add_new_block = items_qnty;try_add_new_block++;
	    // Prepare request object (automatically choose GET or POST).
	    req.open(null, obj.PathToAjaxBackend, true);
		req.send({items_qnty:try_add_new_block,action:obj.action,template:obj.FormTemplate,var_items_qnty:obj.qnty_elem});
	}
	this.remForm = function()
	{
		var obj = this;
		var items_qnty = $('#'+obj.qnty_elem).attr("value");
		alert(items_qnty);
	    if(items_qnty > 0)
	    {
	        $("#"+obj.ItemNamePrefix+"_"+items_qnty).remove();
	    	items_qnty--;
	        $('#'+obj.qnty_elem).attr("value",items_qnty);
	    }
	    else return false;
	}
};
var ContactForm = new FormClass;
ContactForm.qnty_elem = 'contacts_qnty';
ContactForm.wrapper = 'contacts';
//ContactForm.action = 'addContactForm';
ContactForm.ItemNamePrefix = 'contact';
ContactForm.FormTemplate = module.tmpl_dir+'/ContactForm.html';
var EducationForm = new FormClass;
EducationForm.qnty_elem = 'educations_qnty';
EducationForm.wrapper = 'educations';
//EducationForm.PathToAjaxBackend = PathToAjaxBackend;
//EducationForm.action = 'addEducationForm';
EducationForm.ItemNamePrefix = 'education';
EducationForm.FormTemplate = module.tmpl_dir+'/EducationForm.html';
var ExperienceForm = new FormClass;
ExperienceForm.qnty_elem = 'experiences_qnty';
ExperienceForm.wrapper = 'experiences';
//ExperienceForm.PathToAjaxBackend = PathToAjaxBackend;
ExperienceForm.action = 'addExperienceForm';
ExperienceForm.ItemNamePrefix = 'experience';
ExperienceForm.FormTemplate = module.tmpl_dir+'/ExperienceForm.html';
var LanguageForm = new FormClass;
LanguageForm.qnty_elem = 'languages_qnty';
LanguageForm.wrapper = 'languages';
//LanguageForm.PathToAjaxBackend = PathToAjaxBackend;
//LanguageForm.action = 'addLanguageForm';
LanguageForm.ItemNamePrefix = 'language';
LanguageForm.FormTemplate = module.tmpl_dir+'/LanguageForm.html';
var AdditionalForm = new FormClass;
AdditionalForm.qnty_elem = 'additionals_qnty';
AdditionalForm.wrapper = 'additionals';
//AdditionalForm.PathToAjaxBackend = PathToAjaxBackend;
//AdditionalForm.action = 'addAdditionalForm';
AdditionalForm.ItemNamePrefix = 'additional';
AdditionalForm.FormTemplate = module.tmpl_dir+'/AdditionalForm.html';
